package com.billdowney.entity.system;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.annotations.Type;

import com.billdowney.entity.base.BaseEntityIdByUUIDHex;

import io.swagger.annotations.ApiModelProperty;

/**
 * 访问记录
 * 
 * @author 超级小富翁 - BillDowney
 * @data 2017年9月11日 下午10:26:41
 */
@Entity
@Table(name = "system_visit_record")
public class SystemVisitRecord extends BaseEntityIdByUUIDHex {

	private static final long serialVersionUID = -7154184252598257022L;
	@ApiModelProperty(value = "服务器名称")
	@Column(length = 50)
	private String serverName;

	@ApiModelProperty(value = "服务器端口号")
	private int serverPort;

	@ApiModelProperty(value = "项目目录地址")
	@Column(length = 50)
	private String contextPath;

	@ApiModelProperty(value = "客户机的请求方法")
	@Column(length = 10)
	private String method;

	@ApiModelProperty(value = "Servlet的映射路径")
	@Type(type = "text")
	private String servletPath;

	@ApiModelProperty(value = "客户机请求的绝对url")
	@Type(type = "text")
	private String requestURL;

	@ApiModelProperty(value = "客户机请求的相对url")
	@Type(type = "text")
	private String requestURI;

	@ApiModelProperty(value = "客户机的IP地址", notes = "发出请求的客户机的IP地址")
	@Column(length = 46)
	private String remoteAddr;

	@ApiModelProperty(value = "客户机的主机名", notes = "发出请求的客户机的完整主机名")
	@Column(length = 50)
	private String remoteHost;

	@ApiModelProperty(value = "客户机的网络端口号")
	private int remotePort;

	@ApiModelProperty(value = "客户机认证的用户")
	@Column(length = 50)
	private String remoteUser;

	@ApiModelProperty(value = "协议名称")
	@Column(length = 20)
	private String protocol;

	@ApiModelProperty(value = "WEB服务器的IP地址")
	@Column(length = 46)
	private String localAddr;

	@ApiModelProperty(value = "WEB服务器的主机名")
	@Column(length = 50)
	private String localName;

	@ApiModelProperty(value = "WEB服务器的端口号")
	private int localPort;

	@ApiModelProperty(value = "编码集")
	@Column(length = 20)
	private String characterEncoding;

	@ApiModelProperty(value = "内容长度")
	private int contentLength;

	@ApiModelProperty(value = "认证类型")
	@Column(length = 50)
	private String authType;

	@ApiModelProperty(value = "访问协议", notes = "当前链接使用的协议")
	@Column(length = 20)
	private String scheme;

	@ApiModelProperty(value = "浏览器当前语言")
	@Column(length = 20)
	private String locale;

	@ApiModelProperty(value = "sessionId", notes = "1.未禁用cookies：request.getRequestedSessionId()方法获取的值是Cookie中的值，即使URL中有jsessionid的值。2.禁用cookies：request.getRequestedSessionId()方法获取的是值就是URL中的jessionid的值，如果没有，则为NULL")
	@Column(length = 100)
	private String requestedSessionId;

	@ApiModelProperty(value = "真实IP")
	@Column(length = 46)
	private String realIp;

	@ApiModelProperty(value = "客户端类型")
	@Column(length = 50)
	private String client;

	@ApiModelProperty(value = "客户端信息")
	@Type(type = "text")
	private String clientInfo;

	public String getServerName() {
		return serverName;
	}

	public void setServerName(String serverName) {
		this.serverName = serverName;
	}

	public int getServerPort() {
		return serverPort;
	}

	public void setServerPort(int serverPort) {
		this.serverPort = serverPort;
	}

	public String getContextPath() {
		return contextPath;
	}

	public void setContextPath(String contextPath) {
		this.contextPath = contextPath;
	}

	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		this.method = method;
	}

	public String getServletPath() {
		return servletPath;
	}

	public void setServletPath(String servletPath) {
		this.servletPath = servletPath;
	}

	public String getRequestURL() {
		return requestURL;
	}

	public void setRequestURL(String requestURL) {
		this.requestURL = requestURL;
	}

	public String getRequestURI() {
		return requestURI;
	}

	public void setRequestURI(String requestURI) {
		this.requestURI = requestURI;
	}

	public String getRemoteAddr() {
		return remoteAddr;
	}

	public void setRemoteAddr(String remoteAddr) {
		this.remoteAddr = remoteAddr;
	}

	public String getRemoteHost() {
		return remoteHost;
	}

	public void setRemoteHost(String remoteHost) {
		this.remoteHost = remoteHost;
	}

	public int getRemotePort() {
		return remotePort;
	}

	public void setRemotePort(int remotePort) {
		this.remotePort = remotePort;
	}

	public String getRemoteUser() {
		return remoteUser;
	}

	public void setRemoteUser(String remoteUser) {
		this.remoteUser = remoteUser;
	}

	public String getProtocol() {
		return protocol;
	}

	public void setProtocol(String protocol) {
		this.protocol = protocol;
	}

	public String getLocalAddr() {
		return localAddr;
	}

	public void setLocalAddr(String localAddr) {
		this.localAddr = localAddr;
	}

	public String getLocalName() {
		return localName;
	}

	public void setLocalName(String localName) {
		this.localName = localName;
	}

	public int getLocalPort() {
		return localPort;
	}

	public void setLocalPort(int localPort) {
		this.localPort = localPort;
	}

	public String getCharacterEncoding() {
		return characterEncoding;
	}

	public void setCharacterEncoding(String characterEncoding) {
		this.characterEncoding = characterEncoding;
	}

	public int getContentLength() {
		return contentLength;
	}

	public void setContentLength(int contentLength) {
		this.contentLength = contentLength;
	}

	public String getAuthType() {
		return authType;
	}

	public void setAuthType(String authType) {
		this.authType = authType;
	}

	public String getScheme() {
		return scheme;
	}

	public void setScheme(String scheme) {
		this.scheme = scheme;
	}

	public String getLocale() {
		return locale;
	}

	public void setLocale(String locale) {
		this.locale = locale;
	}

	public String getRequestedSessionId() {
		return requestedSessionId;
	}

	public void setRequestedSessionId(String requestedSessionId) {
		this.requestedSessionId = requestedSessionId;
	}

	public String getRealIp() {
		return realIp;
	}

	public void setRealIp(String realIp) {
		this.realIp = realIp;
	}

	public String getClient() {
		return client;
	}

	public void setClient(String client) {
		this.client = client;
	}

	public String getClientInfo() {
		return clientInfo;
	}

	public void setClientInfo(String clientInfo) {
		this.clientInfo = clientInfo;
	}

	@Override
	public String toString() {
		return "SystemVisitRecord [serverName=" + serverName + ", serverPort=" + serverPort + ", contextPath="
				+ contextPath + ", method=" + method + ", servletPath=" + servletPath + ", requestURL=" + requestURL
				+ ", requestURI=" + requestURI + ", remoteAddr=" + remoteAddr + ", remoteHost=" + remoteHost
				+ ", remotePort=" + remotePort + ", remoteUser=" + remoteUser + ", protocol=" + protocol
				+ ", localAddr=" + localAddr + ", localName=" + localName + ", localPort=" + localPort
				+ ", characterEncoding=" + characterEncoding + ", contentLength=" + contentLength + ", authType="
				+ authType + ", scheme=" + scheme + ", locale=" + locale + ", requestedSessionId=" + requestedSessionId
				+ ", realIp=" + realIp + ", client=" + client + ", clientInfo=" + clientInfo + "]";
	}

}
